﻿Type=Activity
Version=5.8
ModulesStructureVersion=1
B4A=true
@EndOfDesignText@
#Region  Activity Attributes 
	#FullScreen: False
	#IncludeTitle: True
#End Region

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.

End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.
	Dim pc As PayCls
	Private edamount As EditText
End Sub

Sub Activity_Create(FirstTime As Boolean)
	'Do not forget to load the layout file created with the visual designer. For example:
	Activity.LoadLayout("laycharge")
	pc.Initialize(Activity)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
Sub ivback_Click
	Activity.Finish
End Sub

Sub btncharge_Click
	 If edamount.Text.Trim.Length<1 Then
	 	comm.T("金额不能为空")
		Return
	End If
	Dim namount As Int
	If IsNumber(edamount.Text) Then
		namount=edamount.Text
	End If
	If namount<1 Then
		Msgbox("输入的金额非法！","错误")
		Return
	End If
	reqcharge1(namount)
End Sub
Sub JobDone(thj As HttpJob)
	ProgressDialogHide
	If thj.Success Then
		Dim str As String=thj.GetString
		Log(str)
		Dim nr As netRes=ParseHelper.getStatusData(str)
		If nr.nCode=200 Then
			Dim parser As JSONParser 
				parser.Initialize(str) 
				Dim root As Map = parser.NextObject 
				Dim data As String = root.Get("data") 
				Dim order_sn As String = root.Get("order_sn") 
				Dim status As String = root.Get("status") 
				Dim pid As payItem
				pid.noinpay=True
				pid.pid=order_sn
				pid.money=edamount.Text
				g_store.put("pid",pid)
				StartActivity(actSelectPayMethod)
				Activity.Finish
		Else
			comm.TL("错误:"&nr.sData)
		End If
	Else
		comm.TL("网络错误:"&thj.JobName&thj.ErrorMessage)
	End If
	thj.Release
End Sub
Sub reqcharge1(n As Int)
	comm.showProgress("正在提交充值请求")
	ParseHelper.doPostReqArr(Me,"reqcharge1",comm.getApi(comm.apiIdx.REQCHARGE1),Array As String("money",n,"is_teach","0"),"")
End Sub